package com.cwj.springboot_study.controller;

import com.cwj.springboot_study.model.Person;
import com.cwj.springboot_study.service.PersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/person")
public class PersonController {

    @Autowired
    private PersonService personService;

    @PutMapping
    public int test(){
        return personService.m1();
    }

    @PostMapping
    public Person add(@RequestBody Person person){
        return personService.add(person);
    }
}
